package com.sgb.kjwl.view.widget;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.amap.api.maps.AMap;
import com.amap.api.maps.model.Marker;
import com.sgb.kjwl.R;

/**
 * 找车marker信息弹窗
 */
public class CarMapInfoWindow implements AMap.InfoWindowAdapter {
    private Context mContext;
    private View infoWindow = null;

    public CarMapInfoWindow(Context context) {
        this.mContext = context;
    }

    /**
     * 监听自定义infoWindow窗口的infoWindow事件回调
     */
    @Override
    public View getInfoWindow(Marker marker) {
        if (infoWindow == null) {
            infoWindow = LayoutInflater.from(mContext).inflate(R.layout.car_msg_info_window, null);
        }
        render(marker, infoWindow);
        return infoWindow;
    }

    /**
     * 监听自定义infoWindow窗口的infoContents事件回调
     */
    @Override
    public View getInfoContents(Marker marker) {
        return null;
    }

    /**
     * 自定义infoWindow窗口
     */
    public void render(Marker marker, View view) {
        //如果想修改自定义InfoWindow中内容，请通过view找到它并修改
    }
}
